package com.opensource.component.validate;

import java.util.regex.Pattern;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
import lombok.Setter;

/**
 * @author ZonLen since on 2022/5/29 上午10:32
 */
public class RegexMain {

  public static void main(String[] args) {
    System.out.println(Pattern.matches("^(?!(0[0-9]{0,}$))[0-9]{1,}[.]{0,}[0-9]{0,8}$", "11111111111111.111111111"));
    System.out.println(ValidationManager.validation().validateEntity(new A("111")).hasError());
  }

//  @Getter
  @Setter
  @AllArgsConstructor
  @NoArgsConstructor
  public static class A{

    @javax.validation.constraints.Pattern(regexp = "^(?!(0[0-9]{0,}$))[0-9]{1,}[.]{0,}[0-9]{0,8}$", message = "111")
    private String a;
  }
}